package com.liuyk.commonlib.router.intercept;

import android.content.Context;
import android.util.Log;

import com.alibaba.android.arouter.facade.Postcard;
import com.alibaba.android.arouter.facade.annotation.Interceptor;
import com.alibaba.android.arouter.facade.callback.InterceptorCallback;
import com.alibaba.android.arouter.facade.template.IInterceptor;

/**
 * 登陆拦截器
 * <p>
 * Created by liuyk on 2019/4/25.
 */
@Interceptor(name = "login", priority = 6)
public class LoginIntercept implements IInterceptor {
    //拦截器会在跳转之间执行，多个拦截器会按优先级顺序依次执行
    private static final String TAG = "ARouter";
    private Context mContext;

    @Override
    public void process(Postcard postcard, InterceptorCallback callback) {
        Log.w(TAG, "LoginIntercept process");
        String path = postcard.getPath();
        callback.onContinue(postcard);
    }

    @Override
    public void init(Context context) {
        Log.w(TAG, "LoginIntercept init");
        mContext = context;
    }
}
